<template name="indexManagement">
    {{#if isConnected}}
        {{> pageHeading title=getPageHeading }}
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>{{_ "index_management"}}
                            </h5>
                            <div class="ibox-tools">
                                <button id="btnRefreshIndexes" type="button" class="btn btn-xs btn-primary">{{_ "refresh"}}
                                </button>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <div class="row">
                                <div class="col-lg-12">
                                    <select id="cmbCollectionsIndexManagement"
                                            data-placeholder="{{_ "select_collection"}}"
                                            class="chosen-select form-control"
                                            tabindex="-1">
                                        <option></option>
                                    </select>
                                </div>
                            </div>

                            <div class="hr-line-dashed"></div>

                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="table-responsive">
                                        <table id="tblIndexes" class="table table-striped table-hover issue-tracker">
                                            <thead>
                                            <tr>
                                                <th>{{_ "fields"}}</th>
                                                <th>{{_ "index_name_info"}}</th>
                                                <th>{{_ "size"}}</th>
                                                <th>{{_ "properties"}}</th>
                                                <th>{{_ "view"}}</th>
                                                <th>{{_ "view_raw"}}</th>
                                                <th>{{_ "delete"}}</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="ibox-footer">
                            <div class="row">
                                <div class="col-lg-12 text-right">
                                    <button class="btn btn-white btn-xs">Ascending</button>
                                    <button class="btn btn-danger btn-xs">Descending</button>
                                    <button class="btn btn-warning btn-xs">Hashed</button>
                                    <button class="btn btn-info btn-xs">2dsphere</button>
                                    <button class="btn btn-primary btn-xs">2d</button>
                                    <button class="btn btn-success btn-xs">Text</button>
                                    <button class="btn index-button btn-xs">GeoHaystack</button>
                                </div>
                            </div>

                            <div class="hr-line-dashed"></div>

                            <div class="row">
                                <div class="col-lg-12">
                                    <button id="btnAddIndex"
                                            class="btn btn-block btn-outline btn-primary ladda-button"
                                            type="button"
                                            data-style="contract">
                                        <strong>{{_ "add_index"}}</strong></button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        {{>addIndex}}
        {{>viewRaw}}
    {{/if}}
</template>
